<%@ page contentType="text/html;charset=utf-8"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript">
$(function()
{		
	//判断点击哪一个列表进行显示
	$("[id*=vote-]").click(function(){
		var type = $(this).attr('typeKey');
		$("#vote [name=type]").val(type);
		$("#vote").submit();
	});	
	
	//下拉框出现与隐藏
    $('.nav-main>li[id]').hover(function()
    {
        /*下拉框出现*/
        var Obj = $(this).attr('id');
        num = Obj.substring(3, Obj.length);
        $('#box-'+num).show();
    }
    ,function()
    {
        /*下拉框隐藏*/
        $('#box-'+num).hide();
    });
    //下拉框显示与消失
    $('.hidden-box').hover(function()
    {
        $(this).show();
    }
    ,function()
    {
        $(this).hide();
    });
    
  //三个标签从上往下展开！
	$(".span3").animate({width:'270px'},1000 );	
	$("#animateController").animate({height:'10px'},1000);
	
	//返回首页
	$("[id=index]").click(function()
	{
		SessionStorage.clear();
		$(this).find("form").submit();
	});
 
	//菜单列表单击事件
	$("[id=manage-1]").click(function()
	{
		saveItem("nav-manage-1",$(this).attr("name"));
		$(this).find("form").submit();
	});
	$("[id=manage-2]").click(function()
	{
		saveItem("nav-manage-2",$(this).attr("name"));
		$(this).find("form").submit();	
		sessionStorage.removeItem("pageParameter");
	}); 
	$("[id=manage-3]").click(function()
	{
		saveItem("nav-manage-3",$(this).attr("name"));
		$(this).find("form").submit();
	});
	$("[id=manage-4]").click(function()
	{
		saveItem("nav-manage-4",$(this).attr("name"));
		$(this).find("form").submit();
	});
	$("[id=manage-5]").click(function()
	{
		saveItem("nav-manage-5",$(this).attr("name"));
		$(this).find("form").submit();
	});
	$("[id=manage-6]").click(function()
	{
		saveItem("nav-manage-6",$(this).attr("name"));
		$(this).find("form").submit();
	});
	$("[id=manage-7]").click(function()
	{
		saveItem("nav-manage-7",$(this).attr("name"));
		$(this).find("form").submit();		
	});
	$("[id=manage-8]").click(function()
	{
		saveItem("nav-manage-8",$(this).attr("name"));
		$(this).find("form").submit();	
	});
	$("[id=log-1]").click(function()
	{
		saveItem("nav-log-1",$(this).attr("name"));
		$(this).find("form").submit();		
	});
	$("#[id=log-2]").click(function()
	{
		saveItem("nav-log-2",$(this).attr("name"));
		$(this).find("form").submit();
	});
	$("#[id=log-3]").click(function()
	{
		saveItem("nav-log-3",$(this).attr("name"));
		$(this).find("form").submit();	
	});
	//}
});


//待投票
function wait()
{
	$("#vote1 [name=type]").val("wait");
	$("#vote1").submit();	
}

//已投票
function alreadyVoted()
{
	$("#vote1 [name=type]").val("alreadyVoted");
	$("#vote1").submit();	
}

//已结束
function finished()
{
	$("#vote1 [name=type]").val("finished");
	$("#vote1").submit();	
}
//获取参数
function getItem(){
	var navinfo = SessionStorage.getItem("navinfo");
	if(navinfo){
		if(navinfo.nav){
			$("#"+navinfo.nav).addClass("active");
			if(navinfo.child){
				$("#"+navinfo.child).addClass("active");
			}
		}
	}
}
//保存参数
function saveItem(id,name)
{
	SessionStorage.setItem("navinfo", {
		nav: name,
		child:id
	});
}
</script>
</head>
<body>
<div id="animateController" style="height:400px;"></div>
	<div class="container" id="mainContainer">		
		<div class="row container3">		
			
			<div class="span3">
				<div class="vote" id="vote-1" name="li-1" typeKey="wait">
					<div class="vote-top">
						<div class="vote-name" >
							<p class="vote-name-cn">待投票</p>
						</div>
					</div>
					<div class="vote-stats">
						<div class="detail">
							<div class="vote-num ">
								<div class="left-container">
									<p>
										<span id="total1" class="total1">${waitVotedCount}</span> <span>待投票</span>
									</p>
								</div>
								<div class="right-container">
									<p>
										<span id="total2" class="total2"></span>
									</p>
								</div>
							</div>
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>去投票</p>
					</div>
				</div>
			</div>
			<div class="span3">
				<div class="vote" id="vote-2" name="li-1" typeKey="alreadyVoted">
					<div class="vote-top"> 
						<div class="vote-name">
							<p class="vote-name-cn">已投票</p>
						</div>
					</div>
					<div class="vote-stats">
						<div class="detail">
							<div class="vote-num ">
								<div class="left-container">
									<p>
										<span id="total3" class="total1">${alreadyVotedCount}</span> <span>进行中 </span>
									</p>
								</div>
								<div class="right-container">
									<p>
										<span class="total2"> </span> <span> </span>
									</p>
								</div>
							</div>
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>去看看</p>
					</div>
				</div>
			</div>
			
			<div class="span3">
				<div class="vote" id="vote-3" name="li-1" typeKey="finished">
					<div class="vote-top">
						<div class="vote-name">
							<p class="vote-name-cn">已结束</p>
						</div>
					</div>
					<div class="vote-stats">
						<div class="detail">
							<div class="vote-num ">
								<div class="left-container">
									<p>
										<span id="total4" class="total1">${endVotedCount}</span> <span>结束</span>
									</p>
								</div>
								<div class="right-container">
									<p>
										<span class="total2">${participated}</span> <span>参与</span>
									</p>
								</div>
							</div>
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>看结果</p>
					</div>
				</div>
			</div>
			
		</div>
		
	 <div><% String autho = (String)session.getAttribute("SESSION_AUTHORITY");
	 if(autho!=null && autho.indexOf("admin")>=0){
	 %>
 
 	 <hr>
 	 <div class="row container3">		
			
			<div class="span3" style="margin-top:0px;" >
				<div class="vote"  id = "log-1" name="li-2" style = "height:90px;">				 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>异常日志<form method="post" action="${ctx}/systemMonitor/exceptionMonitor/exceptionList.do"></form><p>
					</div>
				</div>
			</div> 
			
			<div class="span3" style="margin-top:0px;" >
				<div class="vote" id="log-2" name="li-2" style = "height:90px;">				 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>操作日志<form method="post" action="${ctx}/systemMonitor/userOperationMonitor/userOperationMonitorList.do"></form></p>
					</div>
				</div>
			</div> 
			
			<div class="span3" style="margin-top:0px;" >
				<div class="vote"  id="log-3" name="li-2" style = "height:90px;">					 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>SQL监控<form method="post" action="${ctx}/systemMonitor/SQLMonitor/SQLMonitorList.do"></form></p>
					</div>
				</div>
			</div>
	</div> 
	 <hr>
	 <div class="row container3">		
			
			<div class="span3" style="margin-top:0px;" >
				<div class="vote"  id = "manage-1" name="li-3" style = "height:90px;">		
					<form method="post" action="${ctx}/survey/surveyManagement/surveyList.do"></form>		 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>投票管理</p>
					</div>
				</div>
			</div> 
			
			<div class="span3" style="margin-top:0px;" >
				<div class="vote" id="manage-2" name="li-3" style = "height:90px;">				 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>用户管理<form method="post" action="${ctx}/userManagement/userList.do"></form></p>
					</div>
				</div>
			</div> 
			
			<div class="span3" style="margin-top:0px;" >
				<div class="vote"  id="manage-3" name="li-3" style = "height:90px;">	
							 				 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>角色管理<form method="post" action="${ctx}/roleManagement/roleList.do"></form></p>
					</div>
				</div>
			</div> 
			
			<div class="span3" style="margin-top:30px;" >
				<div class="vote"  id="manage-4" name="li-3" style = "height:90px;">					 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>资源管理<form method="post" action="${ctx}/resourceManagement/resourceList.do"></form></p>
					</div>
				</div>
			 
			</div>
			
			<div class="span3" style="margin-top:30px;" >
				<div class="vote"  id="manage-5" name="li-3" style = "height:90px;">					 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>用户组管理<form method="post" action="${ctx}/groupManagement/userGroupList.do"></form></p>
					</div>
				</div>
			 
			</div>
			
			<div class="span3" style="margin-top:30px;" >
				<div class="vote"  id="manage-6" name="li-3" style = "height:90px;">					 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>组织结构管理<form method="post" action="${ctx}/departmentManagement/departmentList.do"></form></p>
					</div>
				</div>
			 
			</div>
			
			<div class="span3" style="margin-top:30px;" >
				<div class="vote"  id="manage-7" name="li-3" style = "height:90px;">					 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>数据字典管理<form method="post" action="${ctx}/systemDictManagement/loadSystemDictManagement.do"></form></p>
					</div>
				</div>
			 
			</div>
			
			<div class="span3" style="margin-top:30px;" >
				<div class="vote"  id="manage-8" name="li-3" style = "height:90px;">					 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>系统参数管理<form method="post" action="${ctx}/systemParamManagement/systemParamList.do"></form></p>
					</div>
				</div>
			 
			</div>
			
			<div class="span3" style="margin-top:30px;" >
				<div class="vote"  id="manage-5" name="li-3" style = "height:90px;">					 
					<div class="vote-stats">
						<div class="detail">
							 
						</div>
					</div>
					<hr>
					<div class="vote-start">
						<p>菜单管理<form method="post" action="${ctx}/menuManagement/menuList.do"></form></p>
					</div>
				</div>
			 
			</div>
		</div>
	 <%} %>
	 </div>
	</div>
	<form id="vote" method="post" action="${ctx}/survey/surveyList/loadSurveyList.do">
		<input type="hidden" name="type"/>
		<input type="hidden" name="needChangePwd" id="needChangePwd" value="${needPasswordChange}"/>
	</form>
</body>
</html>